import { request } from '@/utils/request';

/**
 * @description
 */
export function getTrafficMonitor(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/trafficMonitor/getTrafficMonitor',
		method: 'get',
		params,
	});
}
export function getTrafficMonitorByTime(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/trafficMonitor/getTrafficMonitorByTime',
		method: 'get',
		params,
	});
}
export function getTrafficRoad(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/trafficMonitor/getTrafficRoad',
		method: 'get',
		params,
	});
}

// 查询重点道路列表接口
export function getCustomRoadSelectList(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/selectByTypeCodeAndRoadName',
		method: 'get',
		params,
	});
}
// 根据标签类型查询道路列表接口
export function getCustomRoadSelectByTypeCodeList(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/selectByTypeCode',
		method: 'get',
		params,
	});
}

// 添加重点道路
export function getCustomRoadInsertRoad(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/insertRoad',
		method: 'post',
		data,
	});
}
// 修改重点道路
export function getCustomRoadUpdateRoad(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/updateRoad',
		method: 'post',
		data,
	});
}
// 删除重点道路
export function getCustomRoadDeleteRoadById(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/deleteRoadById',
		method: 'post',
		data,
	});
}


// 查询重点道路图表数据接口
export function selectYdRoadRecord(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/compareYdRoad', //'/customRoad/selectYdRoadRecord',
		method: 'get',
		params,
	});
}

// 查询重点道路图表数据接口2
export function selectYdRoadRecord2(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customRoad/v2/compareYdRoad', //'/customRoad/selectYdRoadRecord',
		method: 'get',
		params,
	});
}

// 获取片区列表
export function getSelectByParamsList(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customArea/selectByParams',
		method: 'get',
		params,
	});
}

// 修改片区
export function updateArea(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customArea/updateArea',
		method: 'post',
		data,
	});
}
// 添加重点片区
export function insertArea(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customArea/insertArea',
		method: 'post',
		data,
	});
}
// 删除片区
export function deleteAreaById(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/customArea/deleteAreaById',
		method: 'post',
		data,
	});
}

// 重点片区
export function getCongestionCurve(params ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/zdqy/getCongestionCurve',
		method: 'get',
		params,
	});
}
// 重点片区
export function getQueryRoadRank(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/trafficAnalyze/queryRoadRank',
		method: 'post',
		data,
	});
}
//热力图数据获取 
export function getCongestionThermalMap(data ?: API.CaptchaParams) {
	return request<API.CaptchaResult>({
		url: '/observe/getCongestionThermalMap',
		method: 'post',
		data,
	});
}
//根据道路名获取道路中心坐标
export function getCoordinateBySplitName(data ?: any) {
	return request({
		url: '/trafficAnalyze/getCoordinateBySplitName',
		method: 'post',
		data,
	});
}
//获取重点片区信息，返回片区信息，包括坐标集、拥堵指数
export function getHotSpaceInfo(data ?: any) {
	return request({
		url: '/homePage/getHotSpaceInfo',
		method: 'post',
		data,
	});
}
//  比较重点片区拥堵数据  
export function compareAreaCongest(data ?: any) {
	return request({
		url: '/trafficAnalyze/compareAreaCongest',
		method: 'post',
		data,
	});
}
//  比较重点片区拥堵数据  2
export function compare2AreaCongest(data ?: any) {
	return request({
		url: '/trafficAnalyze/v2/compareAreaCongest',
		method: 'post',
		data,
	});
}